<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // 任何事件都是有事件对象
    // document.addEventListener('keydown', function(e) {
    //   console.log(111,  e.keyCode )  // 键码
    // })
    // document.addEventListener('keyup', function(e) {
    //   console.log(222, e.keyCode )  // 键码
    // })

    // 可区分大小写 
    // document.addEventListener('keypress', function(e) {
    //   console.log(333, e.keyCode )  // 键码
    // })
  </script>
</body>
</html>